-- GENERATED SPELL FOR [Sunblade Magister] --


function spell0_24685(pUnit, Event) --@Arcane Nova,Self--
pUnit:FullCastSpellOnTarget(44644,pUnit)
pUnit:RegisterEvent('Sorts_24685', 7500, 1)
end

function spell1_24685(pUnit, Event) --@Arcane Nova,Self--
pUnit:FullCastSpellOnTarget(46036,pUnit)
pUnit:RegisterEvent('Sorts_24685', 7500, 1)
end

function spell2_24685(pUnit, Event) --@Enchantment of Spell Haste,Self--
pUnit:FullCastSpellOnTarget(44604,pUnit)
pUnit:RegisterEvent('Sorts_24685', 642, 1)
end

function spell3_24685(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(44606,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24685', 6000, 1)
end

function spell4_24685(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(46035,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24685', 6000, 1)
end

function Sorts_24685(pUnit, Event)
local choix_sorts_24685 = math.random(0, 4)
if choix_sorts_24685 == 0 then
pUnit:RegisterEvent('spell0_24685', 1, 1)
end
if choix_sorts_24685 == 1 then
pUnit:RegisterEvent('spell1_24685', 1, 1)
end
if choix_sorts_24685 == 2 then
pUnit:RegisterEvent('spell2_24685', 1, 1)
end
if choix_sorts_24685 == 3 then
pUnit:RegisterEvent('spell3_24685', 1, 1)
end
if choix_sorts_24685 == 4 then
pUnit:RegisterEvent('spell4_24685', 1, 1)
end
end

function mob24685_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24685', math.random(1500, 3000), 1)
end

function mob24685_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24685_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24685_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24685, 1, 'mob24685_Action')
RegisterUnitEvent(24685, 2, 'mob24685_Leave')
RegisterUnitEvent(24685, 3, 'mob24685_Kill')
RegisterUnitEvent(24685, 4, 'mob24685_Die')
